// https://leetcode.cn/problems/single-number/?envType=study-plan-v2&envId=top-interview-150

class Solution {
public:
    int singleNumber(vector<int>& nums) {
        int mode = 0;
        for (int i = 0; i < nums.size(); i++) {
            mode ^= nums[i];
        }
        return mode;
    }
};